package com.hospital.spd.util;

import com.github.pagehelper.PageInfo;
import com.hospital.spd.pojo.GoodsUsedQtyDO;
import com.hospital.spd.pojo.PaginationResultVO;

/**
 * @author 97261
 */
public class PaginationResultUtils {

    public static PaginationResultVO<?> paginationResult(PageInfo<?> pageInfo) {
        PaginationResultVO paginationResultVO = new PaginationResultVO();
        PaginationResultVO.Pager pager = new PaginationResultVO.Pager();
        pager.setPage(pageInfo.getPageNum());
        pager.setRecTotal(pageInfo.getTotal());
        pager.setRecPerPage(pageInfo.getPageSize());
        pager.setPages(pageInfo.getPages());

        paginationResultVO.setCode(0);
        paginationResultVO.setMessage("success");
        paginationResultVO.setPager(pager);
        paginationResultVO.setData(pageInfo.getList());
        return paginationResultVO;
    }


}
